<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script>
//        function toHump(str) {
//            var arr = str.split("-");
//            for (var i = 1; i < arr.length; i++) {
//                arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].substring(1);
//            }
//            return arr.join("");
//        }

        function toHump(str) {
            var re = /-(\w)/g;
            return str.replace(re, function ($0,$1) {
                return $1.toUpperCase();
            })

        }

        alert(toHump("aaa-bb-ccc"));
    </script>
</head>
<body>

</body>
</html>